home *** CD-ROM | disk | FTP | other *** search
- Path: airdmhor.gen.nz!not-for-mail
- From: gumboot@airdmhor.gen.nz (Simon Hosie)
- Newsgroups: comp.lang.c
- Subject: What's wrong here?
- Date: 31 Jan 1996 15:46:16 +1300
- Organization: Airdmhor
- Message-ID: <4eml5o$o6h@airdmhor.gen.nz>
- NNTP-Posting-Host: localhost.gen.nz
- X-Newsreader: TIN [version 1.2 PL2]
-
- 1: #include <stdio.h>
- 2:
- 3: typedef unsigned short word;
- 4:
- 5: int main(void)
- 6: {
- 7: word a, b, c, d;
- 8:
- 9: a = 1;
- 10: b = 2;
- 11: c = 4;
- 12: d = a | b | c;
- 13:
- 14: d |= a;
- 15:
- 16: d |= a | b;
- 17: d = d | a | b;
- 18:
- 19: return 0;
- 20: }
-
- Watcom gives the following warnings (and _only_ those warnings) compiling
- the above code (except without the line numbers or colons), but only when
- it's compiling it as C++ and generating 32 bit code (GCC doesn't, no matter
- how hard I try). I don't know C++ myself, but my flatmate is learning it,
- does it have anything to do with the typedef?
-
- TEST.CPP(12): Warning! W389: (col 15) integral value may be truncated during
- assignment or initialization
- TEST.CPP(17): Warning! W389: (col 15) integral value may be truncated during
- assignment or initialization
-